<?php

use Illuminate\Routing\Router;

Route::group([
    'prefix'        => 'admin/DesignerRanking',
    'namespace'     => 'Beerus\\Modules\\DesignerRanking\\Controllers',
    'middleware'    => [
        'web',
        'admin',
    ],
], function (Router $router) {
    $router->get('/searchTag', 'IndexController@searchTag')->name('rank.tag');

    // 榜单分类列表
    $router->get('/index', 'RankingConfigController@list');
    //创建一级榜单分类
    $router->get('/index/create', 'RankingConfigController@firstEdit');
    //编辑一级榜单分类
    $router->get('/index/{firstId}/edit', 'RankingConfigController@firstEdit');
    //保存一级榜单信息
    $router->post('/index/{firstId}/save', 'RankingConfigController@saveFirst');
    //删除一级榜单
    $router->delete('/index/{firstId}', 'RankingConfigController@delConfig');

    //创建二级榜单分类
    $router->get('/index/{firstId}/edit/create', 'RankingConfigController@childRankingEdit');
    //编辑二级榜单
    $router->get('/index/{firstId}/edit/{secondId}/edit', 'RankingConfigController@childRankingEdit');
    //保存二级榜单
    $router->post('/index/{firstId}/edit/{secondId}/save', 'RankingConfigController@saveSecond');
    //删除二级榜单
    $router->delete('/index/{firstId}/edit/{secondId}', 'RankingConfigController@delConfig');
    //修改二级榜单的一级榜
    $router->put('/index/{firstId}/edit/{secondId}', 'RankingConfigController@switchConfigState');

    // 榜单审核管理
    $router->get('/rank/index', 'RankingController@list');
    $router->get('/rank/list/{ranking_month}', 'RankingController@rankList');
    $router->get('/rank/list/{ranking_month}/{first_rank}', 'RankingController@rankList');
    $router->get('/rank/list/{ranking_month}/{first_rank}/{second_rank}', 'RankingController@rankList');
    $router->get('/rank/list/{ranking_month}/{first_rank}/{second_rank}/{third_rank}', 'RankingController@rankList');
    $router->get('/rank/article/{ranking_month}/{first_rank}/{second_rank}/{third_rank}/{aid}/edit', 'RankingController@editArticle');
    $router->post('/rank/article/{ranking_month}/{first_rank}/{second_rank}/{third_rank}/save', 'RankingController@saveArticle');
    $router->post('/rank/designer/{ranking_month}/{first_rank}/{second_rank}/{third_rank}/{id}/remove', 'RankingController@removeDesigner');
    $router->get('/rank/articleAudit/jump/{ranking_month}/{aid}', 'RankingController@jumpArticleAudit');
    $router->get('/rank/articleCover/jump/{ranking_month}/{first_rank}/{second_rank}/{third_rank}/{aid}', 'RankingController@jumpArticleCover');
    $router->post('/rank/designer/batchRemove', 'RankingController@batchRemove')->name('rank.batch_remove');

    // 榜单剔除管理
    $router->get('/remove/index', 'RemoveController@list');
    $router->get('/remove/list/{ranking_month}', 'RemoveController@rankList');
    $router->get('/remove/list/{ranking_month}/{area_code}', 'RemoveController@rankList');
    $router->get('/remove/list/{ranking_month}/{area_code}/{main_rank}', 'RemoveController@rankList');
    $router->get('/remove/list/{ranking_month}/{area_code}/{main_rank}/{sub_rank}', 'RemoveController@rankList');
    $router->get('/remove/ranking/{ranking_month}/{area_code}/{main_rank}/is_over', 'RemoveController@getRankingIsOver');
    $router->post('/remove/designer/{ranking_month}/{area_code}/{main_rank}/{sub_rank}/{id}/revoke', 'RemoveController@RevokeRemoveDesigner');

    // 榜单变化日志管理
    $router->get('/changeLog/index', 'RankingChangeLogController@index');
    $router->post('/rankingPosition/get', 'RankingController@getCurRankingPosition');
    $router->post('/rankingScore/save', 'RankingController@saveRankingScore');

    // 历史榜单
    $router->get('/rank/history', 'RankingController@history');
});
